Clarify RTSP reconnect safety and HTTP error handling for mypy#3263
Clarify RTSP reconnect safety and HTTP error handling for mypy#3263
Conversation
Co-authored-by: MichaIng <28480705+MichaIng@users.noreply.github.com>
|
@copilot Especially |
Mypy was only checking the annotated functions. |
|
@copilot To potentially reduce redundant processing:
|
Co-authored-by: MichaIng <28480705+MichaIng@users.noreply.github.com>
... I removed the redundant |
|
@copilot |
Co-authored-by: MichaIng <28480705+MichaIng@users.noreply.github.com>
Adjusted: Callable now imports only inside the fallback branch so it’s not loaded when |
|
@copilot diff --git a/motioneye/mediafiles.py b/motioneye/mediafiles.py
index b4ea5c3..334d302 100644
--- a/motioneye/mediafiles.py
+++ b/motioneye/mediafiles.py
@@ -105,7 +105,10 @@ _ffmpeg_binary_cache = None
def _list_media_files(
- base_path: str, exts: typing.List[str], sub_path: str | None = None, with_stat: bool = True
+ base_path: str,
+ exts: typing.List[str],
+ sub_path: str | None = None,
+ with_stat: bool = True,
) -> typing.List[tuple]:
# Determine scan path based on sub_path parameter
if sub_path is not None:
@@ -489,7 +492,10 @@ def make_movie_preview(camera_config: dict, full_path: str) -> typing.Union[str,
def list_media(
- camera_config: dict, media_type: str, prefix: str | None = None, with_stat: bool = True
+ camera_config: dict,
+ media_type: str,
+ prefix: str | None = None,
+ with_stat: bool = True,
) -> typing.Awaitable:
fut: Future = Future()
target_dir = camera_config.get('target_dir')
diff --git a/motioneye/utils/dtconv.py b/motioneye/utils/dtconv.py
index 44c4b23..189ea99 100644
--- a/motioneye/utils/dtconv.py
+++ b/motioneye/utils/dtconv.py
@@ -25,11 +25,10 @@ try:
except NameError:
import gettext
from typing import Callable
+
from motioneye import settings
- _: Callable[[str], str] = getattr(
- settings.traduction, 'gettext', gettext.gettext
- )
+ _: Callable[[str], str] = getattr(settings.traduction, 'gettext', gettext.gettext)
def pretty_date_time(date_time, tzinfo=None, short=False):Please apply this. |
Co-authored-by: MichaIng <28480705+MichaIng@users.noreply.github.com>
Signed-off-by: MichaIng <micha@dietpi.com>
Co-authored-by: MichaIng <28480705+MichaIng@users.noreply.github.com>
Signed-off-by: MichaIng <micha@dietpi.com>
Co-authored-by: MichaIng <28480705+MichaIng@users.noreply.github.com>
Signed-off-by: MichaIng <micha@dietpi.com>
e7c5740 to
a803973
Compare
|
@copilot Can you find a solution for this? Looking at the docs for |
Co-authored-by: MichaIng <28480705+MichaIng@users.noreply.github.com>
716894c to
e6d0e94
Compare
Signed-off-by: MichaIng <micha@dietpi.com>
e6d0e94 to
7d70f91
Compare
Original prompt
mypythrows a number or errors, which we currently ignore: